const { Controller } = require('egg');

class BaseController extends Controller {
   
	// 暂时先做简单处理
    ok(data = null, message = 'success', code = 0) {
        this.ctx.status = 200;
		this.ctx.body = {
			code,
			message,
			data
		};
	}
	error(data = null, message = 'error', code = 50000) {
		this.ctx.body = {
			data,
			message,
			code
		};
	}
}

module.exports = BaseController;
